// import { defineConfig, loadEnv } from "vite";
// import vue from "@vitejs/plugin-vue";
// import Components from "unplugin-vue-components/vite";
// import { VantResolver } from "unplugin-vue-components/resolvers";
// import path from "path";
// const resolve = (dir) => path.resolve(__dirname, dir);

// // https://vitejs.dev/config/
// export default defineConfig(({ mode }) => {
//   // 获取当前环境的配置
//   const config = loadEnv(mode, "./");
//   return {
//     plugins: [
//       vue(),
//       AutoImport({
//  resolvers: [VantResolver()],
//       }),
//       Components({
//         resolvers: [VantResolver()],
//       }),
//     ],
//     css: {
//       preprocessorOptions: {
//         scss: {
//           additionalData: ` @import "@/styles/index.scss";   `,
//         },
//       },
//     },
//     resolve: {
//       alias: {
//         "@": resolve("src"), //作为 entries 的选项
//       },
//       extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"],
//     },
//   };
// });



import vue from '@vitejs/plugin-vue';
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from '@vant/auto-import-resolver';

export default {
  plugins: [
    vue(),
    AutoImport({
      resolvers: [VantResolver()],
    }),
    Components({
      resolvers: [VantResolver()],
    }),
  ],
};
